package com.ateam.dao.impl;

import org.mybatis.spring.SqlSessionTemplate;

import com.ateam.dao.NoticesDao;
import com.ateam.pojo.Notices;

/** 
* @author WuYuan
* 
*/
public class NoticesDaoImpl implements NoticesDao {
	private SqlSessionTemplate sqlSessionTemplate;
	
	public SqlSessionTemplate getSqlSessionTemplate() {
		return sqlSessionTemplate;
	}

	public void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate) {
		this.sqlSessionTemplate = sqlSessionTemplate;
	}
	
	@Override
	public Notices getNotice(int companyid) throws Exception {
		return sqlSessionTemplate.selectOne("getNotice", companyid);
	}

	@Override
	public int addNotice(Notices notice) throws Exception {
		return sqlSessionTemplate.insert("addNotice", notice);
	}

}
